﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace QuailDashboard.View.Helpers
{
    public static class Extensions
    {
        public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T> action)
        {
            foreach (var item in source)
            {
                action(item);
            }

            return source;
        }

        public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> source)
        {
            var x = new ObservableCollection<T>();

            foreach (var s in source)
            {
                x.Add(s);
            }

            return x;
        }
    }
}
